//
//  MapPinsModel.m
//  CleanerAir_Project
//
//  Created by 付亚杰 on 16/5/16.
//  Copyright © 2016年 Beijing Colin El Internet. All rights reserved.
//

#import "MapPinsModel.h"

@implementation MapPinsModel  

//+ (NSDictionary *)mj_objectClassInArray{
//    return @{ 
//              @"date" : @"Infos"
//              };
//}

- (NSMutableArray *)date{
    if (_date == nil) {
        _date = [NSMutableArray new];
    }
    return _date;
}

- (void)setValue:(id)value forKey:(NSString *)key{
    
    if ([key isEqualToString:@"date"]) {
        
        for (NSArray *aDic in [value allObjects]) {
            
            if (aDic == [NSNull null]) {
                return;
            }
            
            for (NSDictionary *infoDic in aDic) {
                
                Infos *info = [[Infos alloc] init];
                [info setValuesForKeysWithDictionary:infoDic];
                [self.date addObject:info];
            }
        }
        
        return;
    }
    
    [super setValue:value forKey:key];
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}

@end


@implementation Infos

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
    if ([key isEqualToString:@"id"]) {
        self.ids = value;
    }
    
    
}

- (void)setValue:(id)value forKey:(NSString *)key{
    [super setValue:value forKey:key];
    
    if ([key isEqualToString:@"type"]) {
        
        //【判断蓝点类型，是商家，个人，或者检测点】
        self.annotationType = ((NSString *)value).intValue;

    }
    
    ////    判断商家跳转类型
    if ([key isEqualToString:@"jump_type"]) {

        self.jumpType = ((NSString *)value).intValue;
    }
}



+ (NSDictionary *)mj_replacedKeyFromPropertyName{
    /* 返回的字典，key为模型属性名，value为转化的字典的多级key */
    return @{
             @"ids" : @"id"
             };
}





@end